﻿using System.Windows.Input;
using System;

namespace FtpUploader1
{

    public class VM_MainWindow: VM_Base<VM_MainWindow>
    {
        DelegateCommand _Command1;

        private VM_MainWindow()
        {
            _Command1 = new DelegateCommand(
                param => this.Command1Exe(), param => this.Command1Can());

            CmdGenerationIndexHtml = new DelegateCommand(
                param => this.CmdGenerationIndexHtmlExe());
        }

        private string _field;
        public string Field
        {
            get { return _field; }
            set
            {
                _field = value;
                OnPropertyChanged("Field");
            }
        }

        public ICommand Command1
        {
            get { return _Command1; }
        }

        private void Command1Exe()
        {
            Field = "Гоча1";
        }

        private bool Command1Can()
        {
            return (Field == "Гоча1") ? false : true;
        }

        #region
        public DelegateCommand CmdGenerationIndexHtml
        {
            get;
            private set;
        }

        private void CmdGenerationIndexHtmlExe()
        {
            Utils.GenerationIndexHtml();
        }
        #endregion
    }
}
